macro(addSuffix in_var suffix out_var)
   set(listVar "")
   foreach(var ${in_var})
      list(APPEND listVar "${var}${suffix}")
   endforeach(var)
   set(${out_var} "${listVar}")
endmacro(addSuffix)
macro(addPrefix in_var prefix out_var)
   set(listVar "")
   foreach(var ${in_var})
      list(APPEND listVar "${prefix}${var}")
   endforeach(var)
   set(${out_var} "${listVar}")
endmacro(addPrefix)
macro(addPrefixAndSuffix in_var prefix suffix out_var)
   set(listVar "")
   # message(STATUS "in_var: ${in_var}")
   # message(STATUS "prefix: ${prefix}")
   # message(STATUS "suffix: ${suffix}")
   # message(STATUS "out_var: ${out_var}")
   foreach(var ${in_var})
      list(APPEND listVar "${prefix}${var}${suffix}")
   endforeach(var)
   set(${out_var} "${listVar}")
endmacro(addPrefixAndSuffix)
macro(installHeadersWithDir header_list install_dir)
    foreach(header ${header_list})
		# prefix ./ to header path to avoid empty string match error 
		# if the header happends to be in the root of the source directory
        STRING(REGEX MATCH "(([.a-zA-Z0-9_-]*/)*)" DIR "./${header}")
		# remove the prefixed ./
		STRING(REGEX REPLACE "^(./)" "" DIR2 ${DIR} )
		# message(STATUS "header: ${header} DIR: ${DIR} DIR2: ${DIR2}")
        install(FILES ${header} DESTINATION ${install_dir}/${DIR2})
    endforeach(header)
endmacro(installHeadersWithDir)
macro(findSubPart in_var sub_part found_status)
	set(_found_status 0)
	foreach(var ${in_var})
		if("${var}" STREQUAL "${sub_part}")	
			set(_found_status 1)
		endif()		
	endforeach(var)
	set(${found_status} "${_found_status}")
endmacro(findSubPart)